package proyectoia;

import aima.search.framework.SuccessorFunction;
import java.util.ArrayList;
import java.util.List;

/**
 * @author Brian
 */
public abstract class DistFileSystemSuccessorFunction implements SuccessorFunction {

    private ArrayList<Data> bufferData;

    DistFileSystemSuccessorFunction() {
        this.bufferData = new ArrayList();
    }

    public List popData() {
        ArrayList<Data> aux = bufferData;
        bufferData = new ArrayList();
        return aux;
    }

    @Override
    public List getSuccessors(Object s) {
        DistFileSystemState state = (DistFileSystemState) s;
        bufferData.add(new Data(state));
        DistFileSystem.totalList.addFirst(new Data(state)); // Se usa para las graficas en tiempo real
        return null;
    }
    
    
    @Override
    public String toString() {
        return this.getClass().getName();
    }
}
